<?php

namespace App\Api\Old;

use PhalApi\Api;
use PhalApi\Exception\BadRequestException;


/**
 * 万国觉醒
 * @desc 刺客信条
 */
class Rok extends Api
{
    

    public function getRules()
    {
        return array(
            'rok' => array(
                "date" => array("name" => "date",   "desc" => "date"),
            ),
        );
    }


    /**
     * rok
     * @desc 开启任务
     */
    public function rok()
    {
        // 最简单的处理方式
        header('Access-Control-Allow-Origin: *');
        header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
        header('Access-Control-Allow-Headers: *');
        
        // return 'wenfree';

        $curl = new \PhalApi\CUrl();
        $curl->setHeader(
            array(
                'Sec-Fetch-Site'  => 'cross-site',
                'Sec-Fetch-Mode'  => 'cors',
                'Sec-Fetch-Dest'  => 'empty',
                'Accept'          => '*/*',
                'Connection'      => 'keep-alive',
                'User-Agent'      => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090c33)XWEB/13839',
                'xweb_xhr'        => 1,
                'Authorization'   => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvamsuZG16Z2FtZS5jb21cL3VzZXJzXC9sb2dpbiIsImlhdCI6MTc1MDMyNTQ1MywiZXhwIjoxNzUyOTE3NDUzLCJuYmYiOjE3NTAzMjU0NTMsImp0aSI6InF5RHNGaWNvR09sQUM5TjEiLCJzdWIiOjI1MDg0MiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyIsImRhdGEiOm51bGx9.QqARIo8JUJ2dvzFKCzfes8-z3Vv7y3rzeYHmtoh5TsA'
            ));

        //设置信封速度
        $url = 'https://jk.dmzgame.com/rok/pid/days_areas?days=&areas=678';

        $rs = $curl->get($url, 9000);
        $r = json_decode($rs, true);
        return $r;
    }

    

}
